'use strict'
import React from 'react'
import style from './css.css'
import { View, ScrollView } from '../../component'
import Item from './recordItem'

class Record extends React.Component {
  static propTypes = {
    hanleGameBtnStart: PropTypes.func,
    recordList: PropTypes.object
  }
  _renderList () {
    let { recordList } = this.props
    recordList = recordList.slice()
    if (recordList.length > 0) {
      return recordList.map((item, index) => {
        return <Item item={ { headurl: item.author.headurl, name: item.author.name, time: item.create_at } } key={index} />
      })
    }
  }
  render () {
    return (
      <View className={style.roomBottomBox}>
        <View className={style.roomBottomTitle}>
          <View className={style.roomBottomTitleLine}></View>
          抓中记录
        </View>
        <ScrollView direction = "row" scrollbars = {false} className={style.recordList}>
          {this._renderList()}
        </ScrollView>
      </View>
    )
  }
}

export default Record
